import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter)

const routes = [
  {
    path: '/', component: () => import('../pages/HomePage.vue'), meta: {
      title: '首页'
    }
  },
  {
    path: '/scrollPage', component: () => import('../pages/ScrollPage.vue'), meta: {
      title: '楼层滚动页'
    }
  },
  {
    path: '/calendarPage', component: () => import('../pages/CalendarPage.vue'), meta: {
      title: '日历查看页'
    }
  },
]

// 3. 创建 router 实例，然后传 `routes` 配置
// 你还可以传别的配置参数, 不过先这么简单着吧。
const router = new VueRouter({
  mode: 'hash',
  routes // (缩写) 相当于 routes: routes
})

router.onError((err) => {
  console.log('router handle error', err);
})

export default router;